<include file="Public/min-header" />
<div class="wrapper">
    <include file="Public/breadcrumb" />
    <section class="content">
        <div class="container-fluid">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="fa fa-list"></i>退货单列表</h3>
                </div>
                <div class="panel-body">
                    <div class="navbar navbar-default">
                        <form action="" id="search-form2" class="navbar-form form-inline" method="post" onsubmit="return false">
                            <div class="form-group">
                                <label class="control-label" for="input-order-id">状态</label>
                                <select class="form-control" id="status" name="status">
                                    <option value="-1">全部</option>
                                    <option value="0">未处理</option>
                                    <option value="1">处理中</option>
                                    <option value="2">已完成</option>
                                </select>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="input-order-id">订单 编号</label>
                                <div class="input-group">
                                    <input type="text" name="order_sn" value="" placeholder="订单 编号" id="input-order-id" class="form-control">
                                    <!--<span class="input-group-addon" id="basic-addon1"><i class="fa fa-search"></i></span>-->
                                </div>
                            </div>
                            <button type="submit" onclick="ajaxGetTable('search-form2', 1)" id="button-filter search-order" class="btn btn-primary "><i class="fa fa-search"></i> 筛选</button>
                            <input type="hidden" name="order_by" value="id" />
                            <input type="hidden" name="sort" value="asc" />
                        </form>
                    </div>
                    <div id="ajax_return">
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
<script>
$(document).ready(function() {
    ajaxGetTable('search-form2', 1);

});
// ajax 抓取页面
function ajaxGetTable(tab, page) {
    cur_page = page; //当前页面 保存为全局变量
    $.ajax({
        type: "POST",
        url: "/index.php/Admin/Order/ajaxReturnList/p/" + page,
        data: $('#' + tab).serialize(),
        success: function(data) {
            $("#ajax_return").html('');
            $("#ajax_return").append(data);
        }
    });
}

// 点击排序
function sort_list(field) {
    $("input[name='order_by']").val(field);
    var v = $("input[name='sort']").val() == 'desc' ? 'asc' : 'desc';
    $("input[name='sort']").val(v);
    ajaxGetTable('search-form2', cur_page);
}
</script>
</body>

</html>
